package com.dream.keigezhushou.Activity.kege.acty;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;

import com.dream.keigezhushou.Activity.Uiutils.StringUtils;
import com.dream.keigezhushou.Activity.acty.play.VideoInfoActivity;
import com.dream.keigezhushou.Activity.bean.Image;
import com.dream.keigezhushou.Activity.kege.adapter.KeMyAttentionAdapter;
import com.dream.keigezhushou.R;
import com.handmark.pulltorefresh.library.PullToRefreshListView;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;


/**
 * 我的关注
 */
public class KeMyAttentionActivity extends AppCompatActivity {
    @BindView(R.id.iv_return)
    ImageView ivReturn;
    @BindView(R.id.tv_title)
    TextView tvTitle;

    @BindView(R.id.list_lv)
    PullToRefreshListView mMPullToRefreshListView;
    private ListView mListlv;

    private KeMyAttentionAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_my_attention_ke);
        ButterKnife.bind(this);
        initView();
    }

    //初始化控件
    public void initView() {
        tvTitle.setText("我的关注");
        mListlv = mMPullToRefreshListView.getRefreshableView();

        adapter = new KeMyAttentionAdapter(KeMyAttentionActivity.this);
        mListlv.setAdapter(adapter);

        adapter.setItemOnClickListening(new KeMyAttentionAdapter.ItemOnClickListening() {
            @Override
            public void onEvaluateClick(int position) {
                Intent intent = new Intent(KeMyAttentionActivity.this, VideoInfoActivity.class);
                startActivity(intent);
            }

            @Override
            public void onShareClick(int position) {

            }


            @Override
            public void onItemClick(int position) {
                Intent intent = new Intent();
                intent.putExtra(StringUtils.KEGESTATE, "听歌");
                intent.setClass(KeMyAttentionActivity.this, SingingDetailActivity.class);
                startActivity(intent);

            }
        });


        ivReturn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });


    }
}
